class Game < ActiveRecord::Base
  belongs_to :user
  has_many :players
  has_many :sales
  has_many :prices
  has_many :game_errors
  has_one :game_setting
  has_many :trades

  def player_list
    players = Player.find(:all, :conditions=>["game_id=?",self.id])
    p_array = players.collect {|p| "#{p.name}: #{p.gencode}"}
    return p_array.join(",<br/>").html_safe
  end
end
